package com.ny.service.impl;

import com.ny.dao.ManagerDao;
import com.ny.dao.impl.ManagerDaoImpl;
import com.ny.entity.Manager;
import com.ny.service.ManagerService;

import java.sql.SQLException;
import java.util.List;

public class ManagerServiceImpl implements ManagerService {
    private ManagerDao managerDao = new ManagerDaoImpl();

    @Override
    public Manager login(String name, String password) throws Exception {

        return managerDao.login(name, password);
    }

    @Override
    public List<Manager> findAllManager() throws SQLException, ClassNotFoundException {

        return managerDao.findAllManager();
    }

    @Override
    public int insertManager(Manager manager) throws SQLException, ClassNotFoundException {

        return managerDao.insertManager(manager);
    }

    @Override
    public int updateManager(Manager manager) throws SQLException, ClassNotFoundException {
        return managerDao.updateManager(manager);
    }

    @Override
    public int deleteManager(String name) throws SQLException, ClassNotFoundException {
        return managerDao.deleteManager(name);
    }

}
